# Maintainer: Simon Zeni <simon@bl4ckb0ne.ca>
pkgname=hare
pkgver=0.24.0
pkgrel=1
pkgdesc="The Hare systems programming language"
url="https://harelang.org"
arch="x86_64 aarch64 riscv64"
license="MPL-2.0 AND GPL-3.0-only"
depends="qbe harec binutils"
makedepends="scdoc"
checkdepends="tzdata"
subpackages="$pkgname-doc"
source="
	$pkgname-$pkgver.tar.gz::https://git.sr.ht/~sircmpwn/hare/archive/$pkgver.tar.gz
	$pkgname-rv64-fix.patch
	"

build() {
	cp configs/linux.mk config.mk
	make PREFIX=/usr ARCH=$CARCH VERSION="$pkgver"-alpine
}

check() {
	make ARCH=$CARCH STDLIB_SLOW_TESTS=1 check
}

package() {
	make PREFIX=/usr DESTDIR="$pkgdir" install
}

sha512sums="
d7b96bc031d432e0ca0a9186a043d4cd4af4d4b57be5ce4b913d6acd26cdb708d8c9ad8e2c64c78c192a11a96977d3e916985a548238591b3c4d177b9cc811d9  hare-0.24.0.tar.gz
8982c00cab8449220c0871b60c603e50aaf7b5a2c3015a4ea6d2fad57bcd944203db15e536725f322bcbdf4494fdf39d586d6ddf3c7e11f2c8e0c6461986b974  hare-rv64-fix.patch
"
